package com.ruoyi.common.base.chat.mapstruct;

import com.ruoyi.common.base.chat.domain.ChatMessage;
import com.ruoyi.common.base.chat.dto.ChatMessageAddDTO;
import com.ruoyi.common.base.chat.dto.ChatMessageRetryDTO;
import com.ruoyi.common.base.chat.vo.ChatMessageAppVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ChatMessageStruct
 *
 * @author gdk
 * @version 1.0.0
 * @since 2022/2/8 3:04
 */
@Mapper
public interface ChatMessageStruct {
    ChatMessageStruct INSTANCE = Mappers.getMapper(ChatMessageStruct.class);

    /**
     * ChatMessageAddDTO -> ChatMessage
     *
     * @param dto 实体类
     * @return {@link ChatMessage}
     * @author gdk
     * @since 2022/2/8
     */
    ChatMessage addDTO2Entity(ChatMessageAddDTO dto);

    /**
     * ChatMessageRetryDTO -> ChatMessage
     *
     * @param dto 实体类
     * @return {@link ChatMessage}
     * @author gdk
     * @since 2022/2/8
     */
    ChatMessage retryDTO2Entity(ChatMessageRetryDTO dto);

    /**
     * list -> AppVOList
     *
     * @param list list
     * @return {@link List< ChatMessageAppVO>}
     * @author gdk
     * @since 2022/2/8
     */
    List<ChatMessageAppVO> list2AppVOList(List<ChatMessage> list);
}
